<?php 
JPluginHelper::importPlugin('content');
$dispatcher	= JDispatcher::getInstance();
if (!class_exists('plgContentLightShop')) {
	JError::raiseWarning(50, str_rot13('WYVO_FUBC_REEBE_YBNQ_CYHTVA'));
}
$session = JFactory::getSession();
$cus = $session->get('customer');
?>
<link rel="stylesheet" href="<?php echo JURI::root().'components/com_shop/assets/'; ?>cart.css" type="text/css" />
<div class="title_cart"><?php echo JText::_('MY ORDER');?></div>
<table border="1" width="100%" cellpadding="0" cellspacing="0" class="viewcart">
<thead>
<tr>
    	<td class="title_cart_product"><?php echo JText::_('PICTURE'); ?></td><td class="title_cart_product"><?php echo JText::_('PRODUCT'); ?></td><td class="title_cart_product"><?php echo JText::_('PRICE'); ?></td><td class="title_cart_product"><?php echo JText::_('QUANTITY'); ?></td><td class="title_cart_product"><?php echo JText::_('TOTAL PRICE'); ?></td>
    </tr>
</thead>
<tbody>
<?php 
$path = JURI::root().'images/image_product/thumb/';
foreach($this->carts as $cart):?>
<tr>
    	<td align="center">
        <img src="<?php echo $this->path_img.$cart['image']; ?>" title="<?php echo $cart['title']; ?>" width="100" height="100" class="shop-cart-imgage" />
        </td>
        <td class="shop-title-product-view-cart">
<?php echo $cart['title']; ?>
        </td>
        <td class="shop-price-product-view-cart">
        <?php $dispatcher->trigger('onFormatPrice',array($cart['price'],$cart['currency'],&$price)); echo $price; ?>
        </td>
        <td class="shop-quantity-product-view-cart">
        <?php echo $cart['quantity']; ?>
        </td>
        <td class="shop-total-price-view-cart">
<?php $dispatcher->trigger('onFormatPrice',array($cart['price']*$cart['quantity'],$cart['currency'],&$price)); echo $price; ?>
        </td>
    </tr>
<?php endforeach;?>
</tbody>
<tfoot>
	<tr>
<td colspan="5">
<?php 
$total = 0;
$currency = '';
foreach($this->carts as $cart){
	$total +=$cart['price']*$cart['quantity'];
	$currency = $cart['currency'];
}


?>
    <div class="shop-button-total">
    	<div class="shop-button-total-text"><span class="shop-bt-tt-sp"><?php echo JText::_('TOTAL PRICE'); ?></span><?php $dispatcher->trigger('onFormatPrice',array($total,$currency,&$total)); echo $total; ?></div>
    </div>
    </td>
    </tr>
</tfoot>
</table>
<div class="title-customer"><?php echo JText::_('CUSTOMER INFOMATION'); ?></div>
<ul>
	<li><span><?php echo JText::_('NAME'); ?>:</span><?php echo $cus['username']; ?></li>
    <li><span><?php echo JText::_('EMAIL'); ?>:</span><?php echo $cus['email']; ?></li>
    <li><span><?php echo JText::_('PHONE'); ?>:</span><?php echo $cus['phone']; ?></li>
    <li><span><?php echo JText::_('ADDRESS'); ?>:</span><?php echo $cus['address']; ?></li>
</ul>
<div class="order-product-complete-success">
<?php echo JText::_('ORDER SUCCESS'); ?>
</div>
<div class="order-product-complete-success-des">
<?php echo JText::_('ORDER SUCCESS DES'); ?>
</div>
<div class="order-back-home-page">
<a href="<?php echo JURI::root(); ?>" title="<?php echo JText::_('BACK HOME PAGE'); ?>" class="complete-back-home-page"><?php echo JText::_('BACK HOME PAGE'); ?></a>
</div>